//导出弹窗
var exportExecl ={
    //初始化表格弹窗
    init:function(args){
        this.config(args);
        this.layerWindow(this);
        return this;
    },
    layerWindow: function(that){

       var url =baseloaction+'/admin/common/openExcelPage?type='+that.type
        if(that.valId!=undefined||that.valId!=null){
            url+="&id="+that.valId;
        }
        parent.layer.open({
            type: 2,
            shadeClose: false,
            area: ['940px', '540px'],
            skin: 'layui-layer-demo',
            title: this.title,
            content:[url, 'no'] ,
            btn: ['确认导出','取消'],
            btn2: function(index, layero){
                //关闭窗口
                layer.close(index);
            }, yes: function (index,layero) {
                var _iframe = $(layero).find("iframe:visible");
                var params = $(_iframe[0]).contents().find('#excel-form').serializeJSON();
                if(that.distinguish!=undefined&&that.distinguish!=null){
                    params.distinguish=that.distinguish;
                }
                params = $.param(params);
                var url =that.excelUrl;
                if(that.excelUrl.indexOf('?')>=0){
                    url=  url+"&"+params;
                }else{
                    url=  url+"?"+params;
                }
                window.location.href= baseloaction+url;
            }
        });

    },
    config : function(args) {
        $.extend(this, args);
    },

};
